package com.jk.litterapp.controller;

import com.jk.litterapp.common.BaseController;
import com.jk.litterapp.domain.pojo.Book;
import com.jk.litterapp.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Project: litter-app
 * @Author: Jack
 * @CreateTime: 2018/1/25 16:31
 * @Describe:
 */
@RestController
@RequestMapping(value = "/pub")
public class PublicController extends BaseController {

    @Autowired
    private BookService bookService;

    @GetMapping(value = "/book")
    public Page<Book> getBooks(Pageable pageable){
        return bookService.findPage(pageable);
    }
}
